package com.zhehekeji.opsys.api.entity;

// Generated 2015-4-3 14:42:32 by Hibernate Tools 3.4.0.CR1

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TWinningResult generated by hbm2java
 */
@Entity
@Table(name="t_winning_result")
public class TWinningResult implements java.io.Serializable {

	/** 
	* @Fields serialVersionUID : TODO
	*/ 
	private static final long serialVersionUID = -5298258161223882431L;
	private Long id;
	private TActivity tactivity;
	private TPrize tprize;
	private Date winningTime;
	private Long cpCode;
	private String account;
	private String mobile;
	//0-待发送；1-已发送；2-已领取
	private Integer status = 0;
	/**
	 * 当奖品类型为充值卡时，需要保存卡号与卡密
	 */
	private String cardNo;
	private String cardPwd;
	
	public TWinningResult() {
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER,optional=true)
	@JoinColumn(name="ACTIVITY_ID")
	public TActivity getTactivity() {
		return tactivity;
	}

	public void setTactivity(TActivity tactivity) {
		this.tactivity = tactivity;
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER,optional=true)
	@JoinColumn(name="PRIZE_ID")
	public TPrize getTprize() {
		return tprize;
	}

	public void setTprize(TPrize tprize) {
		this.tprize = tprize;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID",length=20,nullable=false,unique=true)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="WINNING_TIME", nullable=true)
	public Date getWinningTime() {
		return this.winningTime;
	}

	public void setWinningTime(Date winningTime) {
		this.winningTime = winningTime;
	}
	
	@Column(name="CP_CODE",length=20,nullable=true)
	public Long getCpCode() {
		return cpCode;
	}
	
	public void setCpCode(Long cpCode) {
		this.cpCode = cpCode;
	}
	
	@Column(name="ACCOUNT",length=64,nullable=true)
	public String getAccount() {
		return account;
	}
	public void setAccount(String account) {
		this.account = account;
	}
	@Column(name="MOBILE",length=20,nullable=true)
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	@Column(name="CARD_NO",length=32,nullable=true)
	public String getCardNo() {
		return cardNo;
	}
	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}
	@Column(name="CARD_PWD",length=32,nullable=true)
	public String getCardPwd() {
		return cardPwd;
	}
	public void setCardPwd(String cardPwd) {
		this.cardPwd = cardPwd;
	}
	@Column(name="STATUS",length=2,nullable=true)
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
}
